#!/usr/bin/perl -w
use strict;

use lib qw(blib/lib blib/arch ../blib/lib ../blib/arch);
package test;
sub new {
	my $class = shift;
	my $val = shift;
	return bless {val=>$val},$class;
}
sub DESTROY {
	my $self = shift;
	warn "destroy $self->{val}";
}
package main;
use foo;
#use bar;
print "----\n";
{
	my $t = foo::scalar->new(10);
	print $t,"\n";
	print $$t," - \n";
	print $t->val," + \n";
}
print "----\n";
{
	my $t = foo::hash->new(10);
	$t->{test} = new test(10);
	print $t,"\n";
	print $t->val," + \n";
}
print "----\n";
{
	my $t = foo::array->new(10);
	$t->[1] = new test(10);
	print $t,"\n";
	print $t->val," + \n";
}
print "----\n";
